1. Field of the Invention
The present invention relates to color image processing techniques and more particularly, to a color image processing apparatus and method thereof for color enhancement.
2. Description of the Related Art
The HSV (hue, saturation, value), or HSB (hue, saturation, brightness) model was proposed by A. R. Smith (1978) to facilitate a more intuitive interface for color than the selection of three primary colors model, i.e. R, G, and B. The color space has the shape of a hexagonal cone. The HSV cone is a non-linear transformation of the RGB cube and it is referred to as a perceptual model. ‘Perceptual’ means the attributes that are more akin to the way in which human-beings think of color. ‘Perceptual’ does not mean that the color space is perceptually linear. The perceptual non-linearity of RGB space is carried over into HSV space. In particular, the perceptual changes in hue are non-linear with respect to the angle change.
HSV model can be employed in any context where a user requires control or selection of a color on an aesthetic or similar basis. HSV model enables control over the range or gamut of an RGB monitor using the perceptually based variables, i.e. hue, saturation and value/brightness. This means that a user interface can be constructed easily and predictably by varying one of three parameters. An operation, such as making color X brighter, paler or more yellow, is far easier, when these perceptual variables are employed, than deciding on what combinations of RGB changes to be made.
The HSV model is based on polar coordinates (r, e, z) rather than Cartesians coordinates. Hue, or tint or tone, is represented as an angle about the z axis, ranging from 0° through 360°. Vertices of the hexagon are separated by 60° increment. Red is at H=0°, Yellow at H=60°, Green at H=120°, and Cyan at H=180°. Complementary colors are 180° spaced apart from each other.
Distance from the z axis represents Saturation (S): the amount of color present. S varies from 0 to 1. It is represented in this model as the ratio of the purity of a hue. S=1 represents maximum purity of this hue. A hue is said to be one-quarter purity at S=0.25. At S=0, the gray scale is resulted.
V, value of HSV, varies from 0 at the apex of the hexcone to 1 at the bottom of the hexcone. V=0 represents blackness. With V=1, color has his maximum intensity. When V=1 and S=1, we have the pure hue. Whiteness is obtained at the location of V=1 and S=0.
If adjustment of HSV color parameters, H, S, V, are made available to a user of a graphics utility, these parameters are transformed to the RGB setting needed for controlling of the RGB color monitor. To determine the operations needed in this transformation, we recite the well known algorithm in the following about how the HSV hexcone is derived from the RGB cube.
The diagonal from black (the origin) to white of the RGB cube corresponds to the z axis of the HSB hexcone. Each subcube of the RGB cube corresponds to a hexagonal cross-sectional area of the HSB hexcone. At any cross section, all sides of the HSB hexagon and all radial lines from the z axis to any vertex have same V, value. For any set of RGB values, V is equal to the maximum value in this set. The HSB point corresponding to the set of RGB value lies on the hexagonal cross section having value of V. S, Saturation of HSV, is determined as the relative distance of the location of the point from z axis. H, hue of HSV, is determined by calculating the relative position of the point within each sextant of the HSB hexagon. A well known algorithm for mapping set of RGB value into the corresponding HSV value is given in the following procedure (written with C language).
 #include <math.h>#define MIN(a, b) (a<b?a:b)#define MAX(a, b) (a>b?a:b)#define NO_HUE − 1void rgbToHsv(float r, float g, float b, float* h, float* s, float* v) {float max = MAX(r, MAX(g, b));float min = MIN(r, MIN(g, b));float delta = max − min;*v = max;if(max != 0.0) *s = delta/max;else *s= 0.0;if (*s==0.0) *h = NO_HUE;else {if (r==max)*h = (g−b)/delta;else if (g==max)*h = 2 + (b−r)/delta;else if (b==max)*h = 4 + (r−g)/delta;*h *= 60.0;if(*h<0) *h += 360.0;*h /= 360.0;}}
Let max be the maximum value of red, green, blue color components. Let min be the minimum value of red, green, blue color components. Let delta equal to (max−min). According to HSV model, the saturation is defined as delta/max.
For a specific pixel, suppose the corresponding color components have the relation of R>G>B. Then the color hue angle is denoted as θ, where   θ  =      60    ⁢    °    *                            (                      G            -            B                    )                          (                      R            -            B                    )                    .      
And the color saturation is denoted as Ω, where   Ω  =                    (                  R          -          B                )            R        .  